﻿/**********************************************************************
 * @file   GUICreateSEABeamSelectPicklDialog.h
 * @brief  创建SEA梁子系统拾取数据窗口声明
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2025-02-27
 *********************************************************************/
#ifndef _GUICreateSEABeamSelectPicklDialog_H
#define _GUICreateSEABeamSelectPicklDialog_H

#include "GUISubSystemDialogAPI.h"
#include "GUIWidget/GUIDialogBase.h"
#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include <array>

namespace Ui
{
    class GUICreateSEABeamSelectPicklDialog;
}

namespace Core
{
    class FITKActionOperator;
}

namespace Acoustics
{
    class FITKSEASubSysBeam;
}

namespace GUI
{
    /**
     * @brief  Create SEA Beam SelectPickl Dialog
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-10-23
     */
    class GUISubSystemDialogAPI GUICreateSEABeamSelectPicklDialog : public GUIDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief    create object
         * @param[i] oper           operator
         * @param[i] parent
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-10-23
         */
        GUICreateSEABeamSelectPicklDialog(Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief  Destroy object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual ~GUICreateSEABeamSelectPicklDialog();
        /**
         * @brief    获取板数据
         * @return   Acoustics::FITKSEASubSysBeam *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-03
         */
        Acoustics::FITKSEASubSysBeam * getBeamData();

    protected slots:
        /**
         * @brief  radioButton Node clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-02-27
         */
        void on_radioButton_Node_clicked(bool checked);
        /**
         * @brief  radioButton Geometry clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-02-27
         */
        void on_radioButton_Geometry_clicked(bool checked);
        /**
         * @brief  radioButton Node clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-02-27
         */
        void on_radioButton_Mesh_clicked(bool checked);
        /**
         * @brief    拾取方向点数据
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-27
         */
        void on_pushButton_Pick_clicked(bool checked);
        /**
         * @brief cencel button clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        void on_pushButton_Cancel_clicked();
        /**
         * @brief ok button clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        void on_pushButton_OK_clicked();
        /**
         * @brief    创建梁通过节点
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-03
         */
        bool createBeamByNode();
        /**
         * @brief    创建梁通过几何线
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-03
         */
        bool createBeamByGeometry();
        /**
         * @brief    创建梁通过网格梁单元
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-03
         */
        bool createBeamByMesh();
        /**
         * @brief    关闭槽
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        virtual void reject() override;

    protected:
        /**
         * @brief    初始化
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-12
         */
        void init();
        /**
         * @brief    拾取完成处理
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-01
         */
        void pickFinished();
        /**
         * @brief    每次拾取处理接口
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-03
         */
        void pickDataFinished();
        /**
         * @brief  通过ID，获取几何点的xyz数据
         * @param[i] id 
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-03-03
         */
        std::array<double, 3> getGeometryPointXYZ(int id);
        /**
         * @brief    通过ID，获取离散模型的节点数据
         * @param[i] id 
         * @return   std::array<double,3>
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-03-03
         */
        std::array<double, 3> getDiscModelPointXYZ(int id);

    protected:
        /**
         * @brief ui object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Ui::GUICreateSEABeamSelectPicklDialog* _ui = nullptr;
        /**
         * @brief 操作器对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Core::FITKActionOperator* _oper = nullptr;
        /**
         * @brief  梁数据
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-03-03
         */
        Acoustics::FITKSEASubSysBeam* _beamData = nullptr;
        /**
         * @brief  子系统类型
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-12
         */
        int _subSysType{ 0 };
        /**
         * @brief  方向点
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-02-27
         */
        bool _orientationPoint{ false };
    };
}

#endif
